﻿<HTML xmlns:v='urn:schemas-microsoft-com:vml' xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Pragma" content="no-cache">
<link rel="STYLESHEET" type="text/css" id="SkinStyleSheet">
<title>WebNoteEditor</title>
<style>
th{white-space:nowrap}
td.Preview{width:150px;text-align:center;overflow:hidden}
.Previewimg2{width:100px;height:100px}
</style>
<script language="javascript" type="text/javascript" src="../script/windialog.js"></script>
<script language="javascript" type="text/javascript" src="../script/ie2w3c-min.js"></script>
<script language="javascript">
window.onload=function()
{

	renderWindowAsIE(window);
	__loaddata();

	EditorWindow._FormfocusRadio("radioImages",EditorWindow.getUrlArgment("pic",document),document.getElementById("frameView").contentWindow.document)
	AutoResizeDialogWindow();
}

function __btnOk_onclick()
{
	window.returnValue=EditorWindow._FormgetRadioValue("radioImages",document.getElementById("frameView").contentWindow.document);
	//window.returnValue=encodeURIComponent(EditorWindow._FormgetRadioValue("radioImages",document.getElementById("frameView").contentWindow.document));
	window.close();
}


function __btnCancel_onclick()
{
	window.returnValue="";
	window.close();
}

function __loaddata()
{
	var ViewFrm=document.getElementById("frameView").contentWindow;
	var d=ViewFrm.document;
	d.writeln("<table width=\"100%\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" bgcolor=\"#B2CB6B\" class=\"WebNote_DataList2\">");
	d.writeln("<tr>");
	d.writeln("<th align=\"center\" width=\"25px\"></th>");
    d.writeln("<th align=\"center\" >"+EditorWindow.lang_preview+"</th>");
	d.writeln("<th align=\"center\" width=\"80px\">"+EditorWindow.lang_filesize+"</th>");
	d.writeln("<th align=\"center\" width=\"113px\">"+EditorWindow.lang_realsize+"</th>");
	d.writeln("</tr>");
	
	var files=EditorWindow.parent.$WebNoteEditor_allfiles.split("|");
	var extName;
	var i;
	for(i=0;i<files.length;i++)
	{	
		extName=EditorWindow.getFileExt(files[i]);
		
		if (EditorWindow.$config.allow_upload_image_ext.isInArray(extName))
		{
		
			d.write("<tr>");
			d.write("<td>");

			d.write("<input type='radio' value='"+files[i]+"' name='radioImages' id='radio"+i+"'>");

			d.write("</td>");
			d.write("<td align=\"center\" class='Preview'>");
			d.write("<img name='viewImages' src='"+files[i]+"' firstsrc='"+files[i]+"' valign='top' border='0' class='Previewimg' onload=\"javascript:window.parent.__getImageInfo(this);\">");
			d.write("</td>");
		
			d.write("<td align=\"center\"></td>");
			d.write("<td align=\"center\"></td>");

			d.write("</tr>");
		}
			
	}
	d.writeln("</table>");
	if (EditorWindow.$browser.isIE)
		d.createStyleSheet(SkinStyleSheet.href);
	d.body.className="dialog";

}

function __getImageInfo(srcElement)
{
	srcElement.parentNode.nextSibling.innerText=EditorWindow.FileSizeToString(srcElement.fileSize);
	srcElement.parentNode.nextSibling.nextSibling.innerText=srcElement.width+"x"+srcElement.height;
	var sWidth=srcElement.width;
	var sHeight=srcElement.height;
	if (srcElement.width>280)
	{
		srcElement.width=280;
		srcElement.height=srcElement.width/sWidth*sHeight;
	}
	if (srcElement.height>100)
	{
		srcElement.height=100;
		srcElement.width=srcElement.height/sHeight*sWidth;
	}
}
</script>
</head>

<body class="dialog">
<script language="javascript" type="text/javascript">
	//dialogTitle("lang_selectpic");
</script>
<iframe id="frameView" style="width:100%;height:400px" frameborder="no" scrolling="yes"></iframe>

<div style="text-align:right;padding-right:20px">
    	<script language="javascript" type="text/javascript">
    		PrintButtons2();
    	</script>
</div>
</body>  
  
</html>
